class_name AnimationStateComponent
extends StateComponent

var _animator: AnimatedSprite2D

var _animation_name: String


func _init(
	init_name: String,
	init_animator: AnimatedSprite2D,
	init_animation_name: String
) -> void:
	super(init_name)
	_animator = init_animator
	_animation_name = init_animation_name


func _on_setup() -> void:
	pass


func _on_enter() -> void:
	_animator.play(_animation_name)


func _on_update(_delta: float) -> void:
	pass


func _on_exit() -> void:
	_animator.stop()
